#include<iostream>

using namespace std;

int main() {
//		int counter = 1;
//		int init = 1;
//		while (counter < 10000001) {
//			for (int k = 1; k <= init; k++) {
//				numbers[counter][0] = k;
//				numbers[counter][1] = (init - k + 1);
////				System.out.println(numbers[counter]);
//				counter++;
//			}
//			init++;
//		}
		
		int number[1][2];
		int i;
		while (cin >> i) {
			int counter = 1;
			int init = 1;
			bool t = false;
			while (counter <= i) {
				for (int k = 1; k <= init && counter <= i; k++) {
//					numbers[counter][0] = k;
//					numbers[counter][1] = (init - k + 1);
//					System.out.println(numbers[counter]);
					if (t) {
						number[0][0] = k;
						number[0][1] = (init - k + 1);
					} else {
						number[0][1] = k;
						number[0][0] = (init - k + 1);
					}
					
					counter++;
				}
				t = !t;
				init++;
			}
			
			cout << "TERM " << i << " IS " << number[0][0] << "/" << number[0][1] << endl;
		}
	}
